﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Timers;

namespace P2PTransmit.ViewModal
{
    public class TimePeroidClass:IDisposable
    {
        public event Action TimerPeroid;
        Timer Timer;
        public TimePeroidClass()
        {
            Timer = new Timer( 1000 );
            Timer.Elapsed += (a, b) => TimerPeroid?.Invoke();
            Timer.Start();
        }

        public void Stop() => Timer.Stop();

        public void Dispose()
        {
            Timer.Stop();
            Timer.Dispose();
        }
    }
}
